﻿@{
    ViewBag.Title = "Common Command";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
       <ol class="breadcrumb">
    <li><a href="/Home.html">Home</a></li>
    <li><a href="/WebApp/WebApi"> Sanelib WebApp</a></li>
    <li class="active">Generator</li>
</ol>
      
            <div id="introduction">
                <h1 class="text-left">Generator Controller</h1>
                <h4>API</h4>
            </div>
            <div>
                <h4>Constructor Arguments</h4>
                <table class=" table-condensed table-striped">
                    <tr>
                        <th><strong>Parameters</strong></th>
                    </tr>
                    <tr>
                        <td class="table-bordered">IUserSession,</td>
                        <td class="table-bordered">IMapingEngine,</td>
                    </tr>
                </table>
                <h4>Method : Post</h4><code>public HttpResponseMessage Post(DatabaseTableSchema form)</code>

                <article>
                    The Generator Controller generates entity and Procedure to create it. It also creates Database Schema. Now Create a directory and start generating proceduces and DBSchemas.
                    <pre><code>StoredProcedureGenerator.Generate(form, "~/Generated Files/Create" + form.TableName + ".sql");
            EntityGenerator.Generate(form, "~/Generated Files/" + form.TableName + ".cs");
            ViewGenerator.Generate(form, "~/Generated Files/" + form.TableName + "View.cs");
            var dbSchema = Sanelib.Common.SerializerHelper.Xml2Obj&lt;databaseschema&gt;.Load();</code>Every Generated Extension are shown above.</pre>
                    An Id of Type Guid is always generated with the Generator, so there is no need to add an Item of type Guid.
                </article>
                <p>The Serializer Converts i.e serialize from Xml to Object with the database schema instance and is loaded. Then Every table according to the schema is set or say added.</p>
                <code>return Content(response.IsSuccess = true);</code>
                <p class="alert-info">THis will return to the ApiController via <a href="WebApp/SmartApi" class="btn-link">SmartAPiController</a></p>
                <p>An Delete Method is called when there is an existense of the same generated schema,  procedures and entity.</p>
                <code>File.Delete("~/Generated Files/Create" + tableName + ".sql");</code>
                <code>dbSchema.Tables.Remove(table);</code>
                <p class="text-info">To Delete File with extension .SQL</p>
            </div>
      